package com.mxf.code.entity.node;

import lombok.Data;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Property;
import org.springframework.data.neo4j.core.schema.Relationship;
import org.springframework.data.neo4j.core.schema.Relationship.Direction;

import java.util.ArrayList;
import java.util.List;

@Data
@Node("Movie")
public class MovieEntity {

	@Property("title")
	private final String title;
	@Property("tagline")
	private final String description;
	@Id
	@GeneratedValue
	private Long id;
	@Relationship(type = "ACTED_IN", direction = Direction.INCOMING)
	private List<Roles> actorsAndRoles;

	@Relationship(type = "DIRECTED", direction = Direction.INCOMING)
	private List<Person> directors = new ArrayList<>();

	public MovieEntity(String title, String description) {
		this.title = title;
		this.description = description;
	}
}

